<script setup>
import { ref, onMounted } from 'vue'
import { useAxios, loading } from "@/configs/KicoAxios.js";

let axios = useAxios()

let data = ref()

function getDatas() {
  axios.get('/artinfo')
    .then(res => {
      console.log("????:", res)
      data.value = res.data

      loading.value = res.loading
    })
    .catch(err => {
      console.error(err);
    })
}


onMounted(() => {
  console.log("!!!!", loading.value);
  getDatas()
})
</script>

<template>
  <div class="gree" v-if="loading">加载中.....</div>
  <div class="blue" v-else>{{ data }}</div>
</template>

<style scoped>
.gree {
  width: 250px;
  height: 250px;
  background: #06f;
}
</style>
